﻿// -----------------------------------------------------------------------
// <copyright file="MyUrlEditor.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Rosieks.VisualStudio.Web.Flow.CustomCode.Editors
{
    using System;
    using System.Web.UI.Design;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class MyUrlEditor : UrlEditor
    {
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            try
            {
                // Assembly assembly = AppDomain.CurrentDomain.Load("Microsoft.VisualStudio.Web.Mvc.3.01");

                // Type viewHelpersType = assembly.GetType("Microsoft.VisualStudio.Web.Mvc.Util.ViewHelpers");

                // MethodInfo selectLayoutMethod = viewHelpersType.GetMethod("SelectLayout");

                // return selectLayoutMethod.Invoke(null, new[] { "cshtml" }) as string;

                return base.EditValue(context, provider, value);
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
        {
            return base.GetEditStyle(context);
        }
    }
}
